package com.proj.android.canyondefense.core.impl;

import android.media.SoundPool;

import com.proj.android.canyondefense.core.base.ISound;

public class AndroidSound implements ISound {

	private SoundPool _soundPool;
	private int _soundId;
	
	public AndroidSound(SoundPool sndPool, int sndId) {
		this._soundId = sndId;
		this._soundPool = sndPool;
	}
	
	public void play(float volume) {
		this._soundPool.play(_soundId, volume, volume, 0, 0, 1);
	}

	public void dispose() {
		this._soundPool.unload(_soundId);
	}

}
